module ext_tb();
  reg [15:0] imm16;
  reg [1:0] ExtOp;
  wire [31:0] imm32;
  
  ext dut(.imm16(imm16), .ExtOp(ExtOp), .imm32(imm32));
  
  initial begin
    $dumpfile("extwave.vcd");
    $dumpvars(0,ext_tb);
  end
  
  initial begin
    ExtOp = 2'b00;    
    #10  ExtOp = 2'b01;   
    #10  ExtOp = 2'b10;
    #10  ExtOp = 2'b00;
  end
  
  initial begin
    //以16为种的随机数，最高位为1，ZERO与SIGN两种情况可以区分
    imm16 = $random(16);   
  end
endmodule

